
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>客户登录系统-登录</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css" />
</head>
<script type="text/javascript" src="../vue/vue.js"></script>
<script type="text/javascript" src="../vue/axios.js"></script>
<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="../js/base64.js"></script>
<script type="text/javascript" src="../js/crypto-js-4.0.0/crypto-js.js" ></script>
<script type="text/javascript" src="../js/crypto-js-4.0.0/aes.js" ></script>


<body>
    <div class="login-box" id="login-box">
        <div class="login-title">客户录入信息系统-登录</div>
        <table>
            <table>


                <tr>
                    <td>手机号:</td>
                    <td>
                        <input id="tel" type="text" v-model="tel"/>
                    </td>
                    <td id="checkTel"></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button id="submit" v-on:click="dosubmit">登录</button>
                    </td>
                </tr>
            </table>
        </table>
    </div>
</body>
<script>
    var vm = new Vue({
        el:"#login-box",
        data:{
            tel:""
        },
        methods:{

            //登录
            dosubmit:function(){
                console.log(this.tel);
                axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
            //用axios判断成败，成则跳转，败则弹出云云
                axios.post("/users/login",
                    {telNum:this.tel},{headers:{
                    'Content-type':'application/json'
                }}
                    ).then(
               function (value) {
                  if (value.data.msg=="001") {
                      alert(value.data.data);
                      location.href="/page/userList.html"
                  }else{
                      alert(value.data.data);
                  }
               }

                )
            }
        }







    })

</script>
</html>
